import json

with open("./train.json", "r", encoding="utf-8") as f:
    lines = f.readlines()

train = lines[:-1000]
test = lines[-1000:-500]
valid = lines[-500:]


with open("./train_split.json", "w", encoding="utf-8") as f:
    for t in train:
        f.write(t)

with open("./test.json", "w", encoding="utf-8") as f:
    for t in test:
        f.write(t)

with open("./valid.json", "w", encoding="utf-8") as f:
    for t in valid:
        f.write(t)